using System;
using System.Collections.Generic;
using System.Text;
using AF_ORM.CORE;
using System.Data;
using System.Configuration;
using QuanLyThietBi.Config;     
using QuanLyThietBi.Entity;
namespace QuanLyThietBi.ManagerBase
{
                

     public abstract class TBL_ViTriManagerBase
    {
        public TBL_ViTriManagerBase()
        {
            Adapter.ConnectionString =  ConnectionConfig.ConnectionString;            
        }
                    
 
        /// <summary>
        /// Them moi du lieu
        /// </summary>
        /// <returns>TBL_ViTriEntity</returns>
        public TBL_ViTriEntity Insert(TBL_ViTriEntity obj)
        { 
            return (TBL_ViTriEntity) Adapter.Insert(obj);             
        }
 
 
        /// <summary>
        /// Update du lieu theo khoa chinh cua object
        /// </summary>
        /// <returns>TBL_ViTriEntity</returns>
        public TBL_ViTriEntity Update(TBL_ViTriEntity obj)
        { 
            return (TBL_ViTriEntity)Adapter.Update(obj);             
        }
 
 
        /// <summary>
        /// Update du lieu theo dieu kien trong object
        /// </summary>
        /// <returns>TBL_ViTriEntity</returns>
        public TBL_ViTriEntity UpdateWithCondition(TBL_ViTriEntity obj,TBL_ViTriEntity objCond)
        { 
            return (TBL_ViTriEntity)Adapter.UpdateWithCondition(obj,objCond);             
        }
 
 
        public TBL_ViTriEntity Delete(TBL_ViTriEntity obj)
        { 
            return (TBL_ViTriEntity)Adapter.Delete(obj);             
        }
 
 
        public TBL_ViTriEntity DeleteWithCondition(TBL_ViTriEntity objCond)
        { 
            return (TBL_ViTriEntity)Adapter.DeleteWithCondition(objCond);             
        }
 


        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien MaPB duoc set trong object
        /// </summary>
        /// <returns>TBL_ViTriEntity</returns>
        public TBL_ViTriEntity DeleteByMaPB (TBL_ViTriEntity obj)
        { 
            return (TBL_ViTriEntity)Adapter.DeleteByField(obj,"MaPB");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien MaPB 
        /// </summary>
        /// <returns>TBL_ViTriEntity</returns>
        public TBL_ViTriEntity DeleteByMaPB (string MaPB )
        { 
            TBL_ViTriEntity obj = new TBL_ViTriEntity();
            obj.MaPB = MaPB;  
            return (TBL_ViTriEntity)Adapter.DeleteByField(obj,"MaPB");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien MaViTri duoc set trong object
        /// </summary>
        /// <returns>TBL_ViTriEntity</returns>
        public TBL_ViTriEntity DeleteByMaViTri (TBL_ViTriEntity obj)
        { 
            return (TBL_ViTriEntity)Adapter.DeleteByField(obj,"MaViTri");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien MaViTri 
        /// </summary>
        /// <returns>TBL_ViTriEntity</returns>
        public TBL_ViTriEntity DeleteByMaViTri (string MaViTri )
        { 
            TBL_ViTriEntity obj = new TBL_ViTriEntity();
            obj.MaViTri = MaViTri;  
            return (TBL_ViTriEntity)Adapter.DeleteByField(obj,"MaViTri");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien MoTaViTri duoc set trong object
        /// </summary>
        /// <returns>TBL_ViTriEntity</returns>
        public TBL_ViTriEntity DeleteByMoTaViTri (TBL_ViTriEntity obj)
        { 
            return (TBL_ViTriEntity)Adapter.DeleteByField(obj,"MoTaViTri");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien MoTaViTri 
        /// </summary>
        /// <returns>TBL_ViTriEntity</returns>
        public TBL_ViTriEntity DeleteByMoTaViTri (string MoTaViTri )
        { 
            TBL_ViTriEntity obj = new TBL_ViTriEntity();
            obj.MoTaViTri = MoTaViTri;  
            return (TBL_ViTriEntity)Adapter.DeleteByField(obj,"MoTaViTri");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien TenViTri duoc set trong object
        /// </summary>
        /// <returns>TBL_ViTriEntity</returns>
        public TBL_ViTriEntity DeleteByTenViTri (TBL_ViTriEntity obj)
        { 
            return (TBL_ViTriEntity)Adapter.DeleteByField(obj,"TenViTri");
        }

        /// <summary>
        /// Xoa cac dong du lieu thoa dieu kien TenViTri 
        /// </summary>
        /// <returns>TBL_ViTriEntity</returns>
        public TBL_ViTriEntity DeleteByTenViTri (string TenViTri )
        { 
            TBL_ViTriEntity obj = new TBL_ViTriEntity();
            obj.TenViTri = TenViTri;  
            return (TBL_ViTriEntity)Adapter.DeleteByField(obj,"TenViTri");
        }

 
        /// <summary>
        /// Lay du lieu theo khoa chinh object
        /// </summary>
        /// <returns></returns>
        public TBL_ViTriEntity Select(TBL_ViTriEntity obj)
        { 
            return (TBL_ViTriEntity) Adapter.Select(obj);             
        }
 
 
        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns></returns>
        public DataTable SelectWithCondition(TBL_ViTriEntity obj)
        { 
            return  Adapter.SelectWithCondition(obj);             
        }
 
 
        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns></returns>
        public DataTable SelectWithCondition(TBL_ViTriEntity obj,SelectOptions option)
        {             
            return  Adapter.SelectWithCondition(obj,option);             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public DataTable SelectAll()
        { 
            return Adapter.SelectAll(new TBL_ViTriEntity());             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public DataTable SelectAll(SelectOptions option)
        { 
            return Adapter.SelectAll(new TBL_ViTriEntity(),option);             
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public List<TBL_ViTriEntity> SelectAllLST()
        { 
            return  (List<TBL_ViTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectAll(new TBL_ViTriEntity()),new TBL_ViTriEntity());           
        }
 
 
        /// <summary>
        /// Lay tat ca cac du lieu trong table
        /// </summary>
        /// <returns></returns>
        public List<TBL_ViTriEntity> SelectAllLST(SelectOptions option)
        { 
            return (List<TBL_ViTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectAll(new TBL_ViTriEntity(),option),new TBL_ViTriEntity());             
        }
 

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaPB duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaPB (TBL_ViTriEntity obj)
        { 
            return Adapter.SelectByField(obj,"MaPB");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaPB duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaPB (TBL_ViTriEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"MaPB",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaPB duoc set trong object
        /// </summary>
        /// <returns>List<TBL_ViTriEntity></returns>
        public List<TBL_ViTriEntity> SelectByMaPBLST (TBL_ViTriEntity obj)
        { 
            return  (List<TBL_ViTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MaPB"),new TBL_ViTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaPB duoc set trong object
        /// </summary>
        /// <returns>List<TBL_ViTriEntity></returns>
        public List<TBL_ViTriEntity> SelectByMaPBLST (TBL_ViTriEntity obj,SelectOptions option)
        { 
            return  (List<TBL_ViTriEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"MaPB",option),new TBL_ViTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaPB 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaPB (string MaPB )
        { 
            TBL_ViTriEntity obj = new TBL_ViTriEntity();
            obj.MaPB = MaPB;  
            return Adapter.SelectByField(obj,"MaPB");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaPB duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaPB (string MaPB, SelectOptions option)
        { 
            TBL_ViTriEntity obj = new TBL_ViTriEntity();
            obj.MaPB = MaPB;  
            return Adapter.SelectByField(obj,"MaPB",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaPB 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_ViTriEntity> SelectByMaPBLST (string MaPB )
        { 
            TBL_ViTriEntity obj = new TBL_ViTriEntity();
            obj.MaPB = MaPB;  
            return  (List<TBL_ViTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MaPB"),new TBL_ViTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaPB duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_ViTriEntity> SelectByMaPBLST (string MaPB, SelectOptions option)
        { 
            TBL_ViTriEntity obj = new TBL_ViTriEntity();
            obj.MaPB = MaPB;  
            return  (List<TBL_ViTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MaPB",option),new TBL_ViTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaViTri duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaViTri (TBL_ViTriEntity obj)
        { 
            return Adapter.SelectByField(obj,"MaViTri");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaViTri duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaViTri (TBL_ViTriEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"MaViTri",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaViTri duoc set trong object
        /// </summary>
        /// <returns>List<TBL_ViTriEntity></returns>
        public List<TBL_ViTriEntity> SelectByMaViTriLST (TBL_ViTriEntity obj)
        { 
            return  (List<TBL_ViTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MaViTri"),new TBL_ViTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaViTri duoc set trong object
        /// </summary>
        /// <returns>List<TBL_ViTriEntity></returns>
        public List<TBL_ViTriEntity> SelectByMaViTriLST (TBL_ViTriEntity obj,SelectOptions option)
        { 
            return  (List<TBL_ViTriEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"MaViTri",option),new TBL_ViTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaViTri 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaViTri (string MaViTri )
        { 
            TBL_ViTriEntity obj = new TBL_ViTriEntity();
            obj.MaViTri = MaViTri;  
            return Adapter.SelectByField(obj,"MaViTri");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaViTri duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMaViTri (string MaViTri, SelectOptions option)
        { 
            TBL_ViTriEntity obj = new TBL_ViTriEntity();
            obj.MaViTri = MaViTri;  
            return Adapter.SelectByField(obj,"MaViTri",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaViTri 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_ViTriEntity> SelectByMaViTriLST (string MaViTri )
        { 
            TBL_ViTriEntity obj = new TBL_ViTriEntity();
            obj.MaViTri = MaViTri;  
            return  (List<TBL_ViTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MaViTri"),new TBL_ViTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MaViTri duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_ViTriEntity> SelectByMaViTriLST (string MaViTri, SelectOptions option)
        { 
            TBL_ViTriEntity obj = new TBL_ViTriEntity();
            obj.MaViTri = MaViTri;  
            return  (List<TBL_ViTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MaViTri",option),new TBL_ViTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MoTaViTri duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMoTaViTri (TBL_ViTriEntity obj)
        { 
            return Adapter.SelectByField(obj,"MoTaViTri");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MoTaViTri duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMoTaViTri (TBL_ViTriEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"MoTaViTri",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MoTaViTri duoc set trong object
        /// </summary>
        /// <returns>List<TBL_ViTriEntity></returns>
        public List<TBL_ViTriEntity> SelectByMoTaViTriLST (TBL_ViTriEntity obj)
        { 
            return  (List<TBL_ViTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MoTaViTri"),new TBL_ViTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MoTaViTri duoc set trong object
        /// </summary>
        /// <returns>List<TBL_ViTriEntity></returns>
        public List<TBL_ViTriEntity> SelectByMoTaViTriLST (TBL_ViTriEntity obj,SelectOptions option)
        { 
            return  (List<TBL_ViTriEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"MoTaViTri",option),new TBL_ViTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MoTaViTri 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMoTaViTri (string MoTaViTri )
        { 
            TBL_ViTriEntity obj = new TBL_ViTriEntity();
            obj.MoTaViTri = MoTaViTri;  
            return Adapter.SelectByField(obj,"MoTaViTri");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MoTaViTri duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByMoTaViTri (string MoTaViTri, SelectOptions option)
        { 
            TBL_ViTriEntity obj = new TBL_ViTriEntity();
            obj.MoTaViTri = MoTaViTri;  
            return Adapter.SelectByField(obj,"MoTaViTri",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MoTaViTri 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_ViTriEntity> SelectByMoTaViTriLST (string MoTaViTri )
        { 
            TBL_ViTriEntity obj = new TBL_ViTriEntity();
            obj.MoTaViTri = MoTaViTri;  
            return  (List<TBL_ViTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MoTaViTri"),new TBL_ViTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien MoTaViTri duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_ViTriEntity> SelectByMoTaViTriLST (string MoTaViTri, SelectOptions option)
        { 
            TBL_ViTriEntity obj = new TBL_ViTriEntity();
            obj.MoTaViTri = MoTaViTri;  
            return  (List<TBL_ViTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"MoTaViTri",option),new TBL_ViTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenViTri duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByTenViTri (TBL_ViTriEntity obj)
        { 
            return Adapter.SelectByField(obj,"TenViTri");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenViTri duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByTenViTri (TBL_ViTriEntity obj,SelectOptions option)
        { 
            return Adapter.SelectByField(obj,"TenViTri",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenViTri duoc set trong object
        /// </summary>
        /// <returns>List<TBL_ViTriEntity></returns>
        public List<TBL_ViTriEntity> SelectByTenViTriLST (TBL_ViTriEntity obj)
        { 
            return  (List<TBL_ViTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"TenViTri"),new TBL_ViTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenViTri duoc set trong object
        /// </summary>
        /// <returns>List<TBL_ViTriEntity></returns>
        public List<TBL_ViTriEntity> SelectByTenViTriLST (TBL_ViTriEntity obj,SelectOptions option)
        { 
            return  (List<TBL_ViTriEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectByField(obj,"TenViTri",option),new TBL_ViTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenViTri 
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByTenViTri (string TenViTri )
        { 
            TBL_ViTriEntity obj = new TBL_ViTriEntity();
            obj.TenViTri = TenViTri;  
            return Adapter.SelectByField(obj,"TenViTri");
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenViTri duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public DataTable SelectByTenViTri (string TenViTri, SelectOptions option)
        { 
            TBL_ViTriEntity obj = new TBL_ViTriEntity();
            obj.TenViTri = TenViTri;  
            return Adapter.SelectByField(obj,"TenViTri",option);
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenViTri 
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_ViTriEntity> SelectByTenViTriLST (string TenViTri )
        { 
            TBL_ViTriEntity obj = new TBL_ViTriEntity();
            obj.TenViTri = TenViTri;  
            return  (List<TBL_ViTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"TenViTri"),new TBL_ViTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien TenViTri duoc set trong object
        /// </summary>
        /// <returns>DataTable</returns>
        public List<TBL_ViTriEntity> SelectByTenViTriLST (string TenViTri, SelectOptions option)
        { 
            TBL_ViTriEntity obj = new TBL_ViTriEntity();
            obj.TenViTri = TenViTri;  
            return  (List<TBL_ViTriEntity>) EntityUtil.CopyDataTableToEntityList(Adapter.SelectByField(obj,"TenViTri",option),new TBL_ViTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns>List<TBL_ViTriEntity></returns>
        public List<TBL_ViTriEntity> SelectWithConditionLST (TBL_ViTriEntity obj)
        { 
            return  (List<TBL_ViTriEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectWithCondition(obj),new TBL_ViTriEntity());
        }

        /// <summary>
        /// Lay du lieu theo cac dieu kien duoc set trong object
        /// </summary>
        /// <returns>List<TBL_ViTriEntity></returns>
        public List<TBL_ViTriEntity> SelectWithConditionLST (TBL_ViTriEntity obj,SelectOptions option)
        { 
            return  (List<TBL_ViTriEntity>) EntityUtil.CopyDataTableToEntityList( Adapter.SelectWithCondition(obj,option),new TBL_ViTriEntity());
        }

}
}
